package java;

public class test1 {

}
class DataHolder {
    int data1 = 10;
    int data2 = 20;
    public DataHolder(int data1, int data2) {
    	this.data1 = data1;
    	this.data2 = data2;
    }
    
    
    public void setData1(int newData1) {
        this.data1 = newData1;
    }
 
    public void setData2(int newData2) {
        this.data2 = newData2; 
    }
 
    public int getTotal() {
        return data1 + data2;
    }
}
 
public class TestDataHolder {
    public static void main(String[] args) {
        DataHolder dh1 = new DataHolder();
        dh1.setData1(100);
        dh1.setData2(5);
        System.out.println("dh1 data1: " + dh1.data1);
        System.out.println("dh1 data2: " + dh1.data2); 
        System.out.println("dh1 total: " + dh1.getTotal());
        DataHolder dh2 = new DataHolder();
        System.out.println("dh2 total: " + dh2.getTotal());
        System.out.println("dh1 total: " + dh1.getTotal());
        DataHolder dh3 = new DataHolder();
        System.out.println("dh3 total: " + dh3.getTotal());
        DataHolder dh4 = new DataHolder();
        System.out.println("dh4 total: " + dh4.getTotal());
    }
}